const Koa = require("koa");

const app = new Koa();

const router = require("./routes/index");

const koaBody = require("koa-body");

/*
 * 服务器端口 ip
 */
const PORT = 3000;
const HOSTNAME = "localhost";

// 获取客户端数据
app.use(koaBody());

// 挂载路由
app.use(router.routes());

// 监听端口
app.listen(PORT, HOSTNAME, () => {
	console.log(`服务器${HOSTNAME}:${PORT}已经启动!！`);
});
